import 'package:flutter/material.dart';
import 'package:roswell_rgbw/const/const.dart';

class BgPage extends StatelessWidget {
  Widget child;
  BgPage({super.key, required this.child});

  @override
  Widget build(BuildContext context) {
    return LayoutBuilder(
      builder: (BuildContext context, BoxConstraints constraints) {
        return Container(
          padding: EdgeInsets.zero,
          height: constraints.maxHeight,
          width: constraints.maxWidth,
          child: Stack(
            children: [
              Positioned(top: 0, left: 0, right: 0, bottom: 0, child: Image.asset(assets.bg, fit: BoxFit.cover)),
              SizedBox.expand(child: child),
            ],
          ),
        );
      },
    );
  }
}
